<template>
	<view>
		<view class="addr-view">
			<!-- 无地址 新增地址 -->
			<view class="no-addr flex-row-center" @click="addAddr" v-if="!addrInfo">+ 新增收货地址</view>
			<!-- 有地址 -->
			<view class="has-addr flex-row-center" @click="chooseAddr" v-else>
				<view class="addr-left">
					<view class="addr-left-name">
						收件人：{{ $textEllipsis(addrInfo.name, 5) }}
						<text>{{ addrInfo.phone }}</text>
					</view>
					<view style="height: 10rpx;"></view>
					<view class="addr-left-text">{{ addrInfo.province }}{{ addrInfo.city }}{{ addrInfo.region }}{{ addrInfo.address }}</view>
				</view>
				<cmd-icon type="chevron-right" size="16" color="#454545"></cmd-icon>
			</view>
			<image :src="$getImgUrl('home/ic_xian.png')" mode="widthFix" class="img-line"></image>
		</view>

		<view class="goods-view">
			<view class="goods-info flex-row-center" v-for="(item, index) in goodsList" :key="index">
				<image :src="item.img" class="img-goods" mode="aspectFill"></image>
				<view class="goods-info-right flex-col">
					<view class="goods-text">{{ item.name }}</view>
					<view class="price-view  flex-row-center">
						<text class="text-price">¥{{ item.price }}</text>
						<view class="goods-num">x{{ item.num }}</view>
					</view>
				</view>
			</view>
		</view>

		<view class="goods-view" style="padding: 0 30rpx;">
			<view class="youfei flex-row-center">
				<text>运费</text>
				<view style="color: #666; flex:1; text-align: right;">包邮</view>
				<cmd-icon class="icon-arrow" type="chevron-right" size="18" color="#999999"></cmd-icon>
			</view>
			<view class="line"></view>
			<view class="youfei flex-row-center">
				<text>订单备注</text>
				<input type="text" placeholder="留下您的备注~" v-model="comment" />
			</view>
		</view>

		<view style="height: 98rpx;"></view>
		<view class="bottom-view flex-row-center">
			<!-- <view class="all-price-view">¥{{ allPrice }}</view> -->
			<view class="all-price-view">
				需付运费
				<text>¥0</text>
			</view>
			<view class="buy-btn" @click="showPay">确认</view>
		</view>
	</view>
</template>

<script src="./submit.js"></script>

<style lang="scss">
@import '@/style/common.scss';
@import './submit.scss';
</style>
